#!/bin/sh
NFT="/usr/sbin/nft"

# Removing Any Preexisting Rules from table nft-basic
$NFT flush table ip nft-basic

if [ "$1" = "stop" ]
then
    echo "Firewall completely stopped!"
    exit 0
fi

# Load all scripts from /etc/nftables.d/
for script in {{ nft_dir }}/*.nft; do
    if [ -f "$script" ]; then
        $NFT -I {{nft_dir}} -f "$script"
    fi
done

